REM SAMPLE CB-86 PROGRAM THAT CALLS OPT-TECH SORT
REM
REM DEFINE EXTERNAL FUNCTION
DEF SORTCB86(A$, B$, C$, D%,E%) EXTERNAL 
INTEGER SORTCB86
FEND
REM MAIN ROUTINE
INFILE$  = "SAMP.DAT"
OUTFILE$ = "SORTED.DAT"
CTLSTMT$ = "S(1,10,C,A)"
PRINT "CALLING OPT-TECH SORT . . ."
CALL SORTCB86(INFILE$,OUTFILE$,CTLSTMT$,
              VARPTR(NUMRECS%),VARPTR(RETCODE%))
PRINT "BACK FROM OPT-TECH SORT"
PRINT "NUMBER OF RECORDS = ",NUMRECS%
PRINT "SORT STATUS       = ",RETCODE%
END
